package cn.com.e2suntech.demo.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.e2suntech.demo.dao.IUserDao;
import cn.com.e2suntech.demo.service.IUserMgtService;
import cn.com.e2suntech.demo.service.model.UserInfo;

@Service
public class UserMgtService implements IUserMgtService {
    
    @Autowired
    private IUserDao userDao;

    @Transactional
    @Override
    public Long createUser(UserInfo user) {
        return userDao.insertUserInfo(user);

    }

    @Override
    public void deleteUserById(Long userId) {
        userDao.deleteUserById(userId);
        
    }

    @Override
    public UserInfo findUserInfoById(Long userId) {
        return userDao.findUserInfoById(userId);
    }

    @Override
    public void updateUserInfo(UserInfo user) {
        userDao.updateUserInfoById(user);
        
    }

    @Override
    public List<UserInfo> findListUserInfo() {
        return userDao.findListUserInfo();
    }


}
